package com.example.demo.aop;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.concurrent.CompletableFuture;

@Controller
public class TestController {

    @Autowired
    private ManageService manageService;

    @RequestMapping("/test")
    @ResponseBody
    public Object test(){
        CompletableFuture.runAsync(() -> {manageService.action();});
        CompletableFuture.runAsync(() -> {manageService.action2();});
        CompletableFuture.runAsync(() -> {manageService.execute();});
        return "ok";
    }

}
